using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using Utility;
using Entities;

public partial class Admin_Themtourmo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loaddropdownlist();
        }
    }
    private void loaddropdownlist()
    {
        dr_tent.DataSource = tbTourBUS .GetAll();
        dr_tent.DataTextField = tbTourCollumn .tentour .ToString();
        dr_tent.DataValueField = tbTourCollumn .matour .ToString();
        dr_tent.DataBind();
        dr_tent.Items.Insert(0, new ListItem("All", "0"));
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        //try
        //{
        tbTourmo  tourm = new tbTourmo ();
       
        tourm.Matour  = int.Parse(dr_tent.SelectedValue);
      
        tourm.Ngaymo = DateTime.Parse(txt_nm.Text);
        tourm.Ngaykhoihanh  =DateTime .Parse ( txt_nkh .Text);
     

        
        tbTourmoBUS .Insert(tourm);

        Response.Redirect("~/Admin/Danhsachtourmo.aspx");
        //}
        //catch
        //{
        //    Response.Redirect("~/Admin/D_Sanphamdoanhnghiep.aspx?id=" + mdn.ToString());
        //}
    }
}
